package com.service.impl;

import com.mapper.TSysUserMapper;
import com.pojo.TSysUser;
import com.service.TSysUserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TSysUserServiceImpl implements TSysUserService {
    @Autowired
    private TSysUserMapper mapper;
    @Override
    public TSysUser login(String loginName, String password) {
        return mapper.login(loginName,password);
    }

    @Override
    public List<TSysUser> list(Integer page, Integer size,String loginName,String userName) {
        int begin=(page-1)*size;
        return mapper.list(begin,size,loginName,userName);
    }

    @Override
    public int count(String loginName, String userName) {
        return mapper.count(loginName,userName);
    }

    @Override
    public int add(TSysUser tsysUser) {
        return  mapper.add(tsysUser);
    }

    @Override
    public TSysUser selectId(Integer userId) {
        return  mapper.selectId(userId);
    }

    @Override
    public int del(Integer userId) {
        return  mapper.del(userId);
    }

    @Override
    public int edit(TSysUser tsysUser) {
        return  mapper.edit(tsysUser);
    }

    @Override
    public int selectByAccount(String loginName) {
        return  mapper.selectByAccount(loginName);
    }
}
